package com.ssm.Services;

import com.ssm.Entities.Student;
import com.ssm.Mappers.StudentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional(propagation= Propagation.REQUIRED,rollbackFor=Exception.class,timeout=1,isolation= Isolation.DEFAULT)
public class StudentServiceImpl implements StudentService {
    @Autowired
    @Qualifier("studentMapper")
    private StudentMapper studentMapper;
    @Override
    public Student getStudent(Integer id) {
        return studentMapper.getStudentById(id);
    }
}
